package com.prs.crm.service.cqunicom.impl;

import java.io.Serializable;
import java.util.Collection;

import com.prs.crm.dao.cqunicom.CompanyDao;
import com.prs.crm.domain.cqunicom.Company;
import com.prs.crm.service.cqunicom.CompanyService;

import com.prs.crm.service.impl.BaseServiceImpl;

/**
 * @author  WangTing
 *
 * 创建时间：2011-3-4 
 * 
 */
public class CompanyServiceImpl extends BaseServiceImpl<Company, CompanyDao> implements CompanyService {

	@Override
	public Collection<Company> getAllCompany() {
		// TODO Auto-generated method stub
		return this.getDao().getAllCompany();
	}

	

	@Override
	public Collection<Company> getCompanyBySerialNumber(String serial_number) {
		// TODO Auto-generated method stub
		return this.getDao().getCompanyBySerialNumber(serial_number);
	}

	@Override
	public boolean existSameNum(String serial_number) {
		// TODO Auto-generated method stub
		boolean flag =false;
		
		Collection<Company> companys =this.getCompanyBySerialNumber(serial_number);
		//System.out.println(companys.size()+"companys");
		if(companys.size()!= 0){
			flag = true;
		}
		return flag;
		
	}



	@Override
	public Company getCompanyBySerialNum(String serial_number) {
		// TODO Auto-generated method stub
		return this.getDao().getCompanyBySerialNum(serial_number);
	}



	@Override
	public Company getCompany(Serializable id) {
		// TODO Auto-generated method stub
		return this.getDao().getCompany(id);
	}



	@Override
	public Company getByName(String name) {
		// TODO Auto-generated method stub
		return this.getDao().getByName(name);
	}

}
